# -*- coding: utf-8 -*-
# @Time    : 2024/1/14 20:55
# @Author  : micah
# @File    : 25.单行模式与多行模式.py
# @Software: PyCharm
import re

content = """001-苹果价格-60
002-橙子价格-70
003-香蕉价格-80
"""

# re.M表示开启多行匹配
for temp in re.findall(r'^\d+', content, re.M):
    print(temp)

for temp in re.findall(r'\d+$', content, re.M):
    print(temp)
